

import request from '@/utils/request'

export function systemConfigCheck(pram) {
  const data = {
    name: pram.name
  }
  return request({
    url: '/admin/system/config/check',
    method: 'GET',
    params: data
  })
}

export function systemConfigInfo(pram) {
  const data = {
    formId: pram.id
  }
  return request({
    url: '/admin/system/config/info',
    method: 'GET',
    params: data
  })
}

export function systemConfigSave(pram) {
  return request({
    url: '/admin/system/config/save/form',
    method: 'POST',
    data: pram
  })
}

export function fileImageApi(pram) {
  return request({
    url: '/uploadFile',
    method: 'POST',
    data: pram
  })
}
export function fileListApi(params) {
  let url = '/fileList'
  //if (modelName === 'person') url = '/att/getAttachmentList'
  return request({
    url: url,
    method: 'get',
    params
  })
}
export function fileDeleteApi(id) {
  return request({
    url: '/resource_dels',
    method: 'POST',
    data:{ids:id}
  })
}
export function attachmentMoveApi(data,modelName) {
  let url = '/updateAttachment'
  if (modelName === 'person') url = '/att/updateAttachment'
  return request({
    url: url,
    method: 'post',
    data
  })
}



/**
 * 微信上传图片
 * @param data
 */
export function wechatUploadApi(data, params) {
  return request({
    url: `/admin/wechat/media/upload`,
    method: 'post',
    data,
    params
  })
}

